package com.xoa.controller.hr;

import com.xoa.model.hr.*;
import com.xoa.model.hr.learningExperience.LearningExperience;
import com.xoa.model.hr.socialRelations.SocialRelations;
import com.xoa.model.hr.staffCare.HrStaffCare;
import com.xoa.service.hr.*;
import com.xoa.service.hr.learningExperience.LearningExperienceService;
import com.xoa.service.hr.socialRelations.SocialRelationsService;
import com.xoa.service.hr.staffCare.HrStaffCareService;
import com.xoa.util.ToJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 创建者：戚中校
 * 类作用：人事分析模块接口
 */
@Controller
@RequestMapping("/hr/manage")
public class HrStaffAnalysis {

    @Autowired
    HrSStaffInfoService hrSStaffInfoService;
    @Autowired
    HrphotoService hrphotoService;
    @Autowired
    HrStaffIncentiveService hrStaffIncentiveService;
    @Autowired
    HrStaffContractService hrStaffContractService;
    @Autowired
    LearningExperienceService learningExperienceService;
    @Autowired
    HrWorkExperienceService hrWorkExperienceService;
    @Autowired
    HrStaffLaborSkillsService hrStaffLaborSkillsService;
    @Autowired
    SocialRelationsService socialRelationsService;
    @Autowired
    HrTransferService hrTransferService;
    @Autowired
    HrStaffLeaveService hrStaffLeaveService;
    @Autowired
    HrStaffReinstatementService hrStaffReinstatementService;
    @Autowired
    HrStaffTitleEvaluationService hrStaffTitleEvaluationService;
    @Autowired
    HrStaffCareService hrStaffCareService;

    /**
     * 创建者：戚中校
     * 方法作用：根据条件查询数量
     * @param
     * @param deptId(传入的多个部门的编号)
     * @return 返回的json字符串中  nums是返回的结果的数量
     *
     */
    @ResponseBody
    @RequestMapping("/selInfoNums")
    public ToJson<HrStaffInfo> selectNumByCon(HrStaffInfo record, Integer[] deptId){
        return hrSStaffInfoService.selectNumByCon(record,deptId);
    }

    /**
     * 合同数量
     * @param record
     * @param deptId
     * @return
     */
    @ResponseBody
    @RequestMapping("/selContractNums")
    public ToJson<HrStaffContract> selectNumByCon(HrStaffContract record, Integer[] deptId){
        return hrStaffContractService.selectNumByCon(record,deptId);
    }



    /**
     * 奖惩数量
     * @param record
     * @param deptId
     * @return
     */
    @RequestMapping("/selIncNums")
    @ResponseBody
    public ToJson<HrStaffIncentive> selIncNums(HrStaffIncentive record, Integer[] deptId) {
        return hrStaffIncentiveService.selectNumByCon(record,deptId);
    }


    /**
     * 创建者：戚中校
     * 方法作用：根据条件查询数量
     * @param
     * @param deptId(传入的多个部门的编号)
     * @return 返回的json字符串中  nums是返回的结果的数量
     *
     */
    @ResponseBody
    @RequestMapping("/selPhotoNums")
    public ToJson<Hrphoto> selectNumByCon(Hrphoto record, Integer[] deptId) {
        return hrphotoService.selectNumByCon(record,deptId);
    }

    /**
     * 创建者：戚中校
     * 方法作用：学习经历查询数量信息
     * @param record
     * @param deptId
     * @return
     */
    @RequestMapping("/selLearnExNums")
    @ResponseBody
    public ToJson<LearningExperience> selectNumByCon(LearningExperience record, Integer[] deptId){
        return learningExperienceService.selectNumByCon(record,deptId);
    }

    //工作经历查数量
    @ResponseBody
    @RequestMapping("/selWorkExNums")
    public ToJson<HrWorkExperience> selectNumByCon(HrWorkExperience record, Integer[] deptId) {
        return hrWorkExperienceService.selectNumByCon(record,deptId);
    }

    //人力门户图表接口 查询全部人的岗位统计
    @ResponseBody
    @RequestMapping("/selectNumPost")
    public ToJson<HrWorkExperience> selectNumPost(HrWorkExperience record) {
        return hrWorkExperienceService.selectNumPost(record);
    }

    /**
     * 劳动技能
     * @param record
     * @param deptId
     * @return
     */
    @RequestMapping("/selLaborNums")
    @ResponseBody
    public ToJson<HrStaffLaborSkills> selLaborNums(HrStaffLaborSkills record, Integer[] deptId) {
        return hrStaffLaborSkillsService.selectNumByCon(record,deptId);
    }

    /**
     * 创建者：戚中校
     * 方法作用：社会关系查询数量
     * @param
     * @param deptId(传入的多个部门的编号)
     * @return 返回的json字符串中  nums是返回的结果的数量
     *
     */
    @RequestMapping("/selSocialNums")
    @ResponseBody
    public ToJson<SocialRelations> selectNumByCon(SocialRelations record, Integer[] deptId) {
        return socialRelationsService.selectNumByCon(record,deptId);
    }

    /**
     * 创建者：戚中校
     * 方法作用：人事分析人事调动信息数量查询
     * @param
     * @return
     */
    @RequestMapping("/selTranNums")
    @ResponseBody
    public ToJson<HrTransfer> selectNumByCon(HrTransfer record, Integer[] deptId){
        return hrTransferService.selectNumByCon(record,deptId);
    }

    /**
     * 离职查数量
     */
    @RequestMapping("/selLeaveNums")
    @ResponseBody
    public ToJson<HrStaffLeave> selectNumByCon(HrStaffLeave record,Integer[] deptId){
        return  hrStaffLeaveService.selectNumByCon(record,deptId);
    }



    /**
     * 创建者：戚中校
     * 方法作用：复职查询数量
     * @param
     * @param deptId(传入的多个部门的编号)
     * @return 返回的json字符串中  nums是返回的结果的数量
     *
     */
    @RequestMapping("/selReinNums")
    @ResponseBody
    public ToJson<HrStaffReinstatement> selectNumByCon(HrStaffReinstatement record, Integer[] deptId) {
        return hrStaffReinstatementService.selectNumByCon(record,deptId);
    }


    /**
     * 职称评定
     * @param record
     * @param deptId
     * @return
     */
    @RequestMapping("/selEvaNums")
    @ResponseBody
    public ToJson<HrStaffTitleEvaluation> selectNumByCon(HrStaffTitleEvaluation record, Integer[] deptId){
        return  hrStaffTitleEvaluationService.selectNumByCon(record,deptId);
    }


    //员工关怀

    @RequestMapping("/selCareNums")
    @ResponseBody
    public ToJson<HrStaffCare> selectNumByCon(HrStaffCare record, Integer[] deptId) {
        return  hrStaffCareService.selectNumByCon(record,deptId);
    }


    /**
     * 主页面
     * @return
     */
    @RequestMapping("/staff_analysis")
    public String homePage(){
        return "app/hr/hrAnalysis/index";
    }


    /**
     * 人事档案页面
     * @return
     */
    @RequestMapping("/Files")
    public String staffHrFiles(){
        return "app/hr/hrAnalysis/hrFiles";
    }

    /**
     * 合同页面
     * @return
     */
    @RequestMapping("/Contract")
    public String staffContract(){
        return "app/hr/hrAnalysis/contract";
    }
    /**
     * 奖惩页面
     * @return
     */
    @RequestMapping("/rewards")
    public String staffRewards(){
        return "app/hr/hrAnalysis/rewards";
    }

    /**
     * 证照页面
     * @return
     */
    @RequestMapping("/photo")
    public String staffPhoto(){
        return "app/hr/hrAnalysis/photo";
    }

    /**
     * 学习经历页面
     * @return
     */
    @RequestMapping("/study")
    public String staffStudy(){
        return "app/hr/hrAnalysis/study";
    }

    /**
     * 工作经历页面
     * @return
     */
    @RequestMapping("/work")
    public String staffWork(){
        return "app/hr/hrAnalysis/work";
    }

    /**
     * 劳动技能页面
     * @return
     */
    @RequestMapping("/laborSkills")
    public String staffLaborSkills(){
        return "app/hr/hrAnalysis/LaborSkills";
    }


    /**
     * 社会关系页面
     * @return
     */
    @RequestMapping("/socialRelations")
    public String staffSocialRelations(){
        return "app/hr/hrAnalysis/SocialRelations";
    }

    /**
     * 人事调动页面
     * @return
     */
    @RequestMapping("/personnelMobilization")
    public String staffPersonnelMobilization(){
        return "app/hr/hrAnalysis/PersonnelMobilization";
    }


    /**
     * 离职管理页面
     * @return
     */
    @RequestMapping("/leaveManagement")
    public String staffleaveManagement(){
        return "app/hr/hrAnalysis/LeaveManagement";
    }

    /**
     * 复职管理页面
     * @return
     */
    @RequestMapping("/remissionManagement")
    public String staffRemissionManagement(){
        return "app/hr/hrAnalysis/RemissionManagement";
    }

    /**
     * 职称评定页面
     * @return
     */
    @RequestMapping("/titleEvaluation")
    public String staffTitleEvaluation(){
        return "app/hr/hrAnalysis/TitleEvaluation";
    }

    /**
     * 员工关怀页面
     * @return
     */
    @RequestMapping("/employeeCare")
    public String staffEmployeeCare(){
        return "app/hr/hrAnalysis/EmployeeCare";
    }

}
